package cn.ad.server.web.spring.model.gdt;

import com.baidu.bjf.remoting.protobuf.FieldType;
import com.baidu.bjf.remoting.protobuf.annotation.Protobuf;
import org.apache.commons.lang3.builder.ToStringBuilder;

public class GDTBid implements Comparable<GDTBid> {

	@Protobuf(required = true)
	private String creative_id;

	@Protobuf(required = true)
	private int bid_price;

	@Protobuf
	private String impression_param;

	@Protobuf
	private String click_param;

	@Protobuf(fieldType = FieldType.OBJECT)
	private GDTDynamicCreative dynamicCreative;

	@Protobuf
	private boolean app_filter;

	/**
	 * 策略优先级，不需要序列化
	 */
	private int strategy_priority;

	public int getStrategy_priority() {
		return strategy_priority;
	}

	public void setStrategy_priority(int strategy_priority) {
		this.strategy_priority = strategy_priority;
	}

	public String getCreative_id() {
		return creative_id;
	}

	public void setCreative_id(String creative_id) {
		this.creative_id = creative_id;
	}

	public int getBid_price() {
		return bid_price;
	}

	public void setBid_price(int bid_price) {
		this.bid_price = bid_price;
	}

	public String getImpression_param() {
		return impression_param;
	}

	public void setImpression_param(String impression_param) {
		this.impression_param = impression_param;
	}

	public String getClick_param() {
		return click_param;
	}

	public void setClick_param(String click_param) {
		this.click_param = click_param;
	}

	public GDTDynamicCreative getDynamicCreative() {
		return dynamicCreative;
	}

	public void setDynamicCreative(GDTDynamicCreative dynamicCreative) {
		this.dynamicCreative = dynamicCreative;
	}

	public boolean isApp_filter() {
		return app_filter;
	}

	public void setApp_filter(boolean app_filter) {
		this.app_filter = app_filter;
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}

	@Override
	public int compareTo(GDTBid o) {
		return this.getStrategy_priority() - o.getStrategy_priority();
	}

}
